package com.controller;

import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.util.Map;

import org.springframework.util.StringUtils;

@Controller
@RequestMapping("/log")
public class LogController {
    private static Logger logger = Logger.getLogger(LogController.class);

    @ResponseBody
    @RequestMapping(value = "/logPrint", method = RequestMethod.POST)
    public boolean logPrint(@RequestParam String hanshu){

        try {
            logger.info("*******************************************");
            logger.info("函数名为"+hanshu);
            logger.info("*******************************************");
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            logger.info("-------------------------------------------");
            logger.info("error");
            logger.info("-------------------------------------------");
            return false;
        }


    }
}
